﻿<%@ Page Language="C#" MasterPageFile="~/Template/Detail.master" AutoEventWireup="true"
    CodeFile="AttendencesDetail.aspx.cs" Inherits="Page_AttendencesDetail" Title="无标题页" %>

<%@ Register Src="~/Control/TabberHeader.ascx" TagName="TabberHeader" TagPrefix="wsc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .btn
        {
            border-right: #2C59AA 1px solid;
            padding-right: 2px;
            border-top: #2C59AA 1px solid;
            padding-left: 2px;
            font-size: 12px;
            filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5);
            border-left: #2C59AA 1px solid;
            cursor: hand;
            color: black;
            padding-top: 2px;
            border-bottom: #2C59AA 1px solid;
        }
    </style>
    <style media="print" type="text/css">
        .NotPrint
        {
            display: none;
        }
    </style>

    <script>
        function ChangeDetailView1() {
            var height = document.body.clientHeight;
            var infoDetail = document.getElementById("trInfo1");
            if (infoDetail.style.display == 'none') {
                document.getElementById("imgExpand1").src = "../Images/Icon/icon-collapse.png";
                infoDetail.style.display = '';
            }
            else {
                document.getElementById("imgExpand1").src = "../Images/Icon/icon-expand.png";
                infoDetail.style.display = 'none';
            }
            PageResize();
        }

        function ChangeDetailView2() {
            var height = document.body.clientHeight;
            var infoDetail = document.getElementById("trInfo2");
            if (infoDetail.style.display == 'none') {
                document.getElementById("imgExpand2").src = "../Images/Icon/icon-collapse.png";
                infoDetail.style.display = '';
            }
            else {
                document.getElementById("imgExpand2").src = "../Images/Icon/icon-expand.png";
                infoDetail.style.display = 'none';
            }
            PageResize();
        }
        function refreshParent() {
            window.parent.document.getElementById('ctl00$ListToolBarPlaceHolder$btnRefresh').click();
        }

        function openEdit() {
            var width = 820;
            var height = 640;
            window.open("EditAttendencesList.aspx?ID=<%=AttendID %>&NoCache=" + Math.random(), "newwindow", 'width=' + width + ',height=' + height + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=' + (screen.width - width) / 2 + ',top=' + (screen.height - height) / 2);
        }
        function printDetail() {
            window.print();
        }
        function CheckBoxOnClick(index, count) {
            var checkboxid;
            var labid;
            var labvalue = "未选定";
            if (index > 9) {
                checkboxid = "ctl00_Div2ContentPlaceHolder_rptItemList_ctl" + index + "_ddlUser_";
            }
            else {
                checkboxid = "ctl00_Div2ContentPlaceHolder_rptItemList_ctl0" + index + "_ddlUser_";
            }
            if (index > 9) {
                labid = "ctl00_Div2ContentPlaceHolder_rptItemList_ctl" + index + "_labUser";
            }
            else {
                labid = "ctl00_Div2ContentPlaceHolder_rptItemList_ctl0" + index + "_labUser";
            }
            for (var i = 0; i < count; i++) {
                var checkid = checkboxid + i;
                if (document.getElementById(checkid).checked) {
                    if (labvalue == "未选定") {
                        labvalue = document.getElementById(checkid).nextSibling.innerHTML;
                    }
                    else {
                        labvalue += ";" + document.getElementById(checkid).nextSibling.innerHTML;
                    }
                }
            }
            document.getElementById(labid).innerHTML = labvalue;
        }
    </script>

    <%--<script type="text/javascript">
       function SelectUser() {
            var returnValue = window.showModalDialog("../Function.Web/UserChooser.aspx?SelectType=User&nocache=" + Math.random() * 10000 + "&ReturnValueFormat="
            + encodeURI("<%=txtNewUserIDs.ClientID %>:ID|<%=txtNewUsers.ClientID %>:Name|<%=txtNewUserNames.ClientID %>:DisplayName"),
            document, "dialogWidth:800px;dialogHeight:600px;status:yes;resizable:no");
        }
       function ChooseUser(obj) {
            if (document.getElementById("<%=lbtnShutDowm.ClientID %>")) {
                obj.childNodes[0].style.display = "";
                obj.childNodes[1].style.display = "none";
                obj.setAttribute("title", "选择完毕，点击页面上方的保存按钮保存所选值班人员");
            }
            else {
                obj.setAttribute("title", "值班已发布，不能修改");
            }
        }
</script>--%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ListToolBarPlaceHolder" runat="Server">
    <div style="display: none">
        <asp:TextBox ID="tbLeaderCode" runat="server"></asp:TextBox>
        <asp:Button ID="btnRefresh" runat="server" OnClick="btnRefresh_Click" />
    </div>
    <table cellspacing="2" cellpadding="0" border="0" id="tblOperator" runat="server">
        <tr>
            <td class="ToolMenu" width="60" id="tdEdit" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)"
                    onclick="openEdit();">
                    <span>
                        <img src="../Images/Icon/object/Dataset-edit.gif" /></span><span>编辑</span>
                </div>
            </td>
            <td class="Fg" id="tdEditFg" runat="server">
                <img src="../Images/FgLine.gif" alt="" />
            </td>
            <td class="ToolMenu" width="60" id="tdDelete" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                    <asp:LinkButton runat="server" ID="lbtnDelete" OnClick="lbtnDelete_Click" OnClientClick="return window.confirm('确认删除?');">
                        <span><img src="../Images/Icon/ACTION/delete.gif" /></span><span>删除</span>
                    </asp:LinkButton>
                </div>
            </td>
            <%--            <td class="ToolMenu" width="60" id="td1" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                    <asp:LinkButton runat="server" ID="lbtnShutDowm" OnClick="lbtnShutDown_Click" OnClientClick="return window.confirm('确认发布当前值班安排?');">
                        <span><img src="../Images/Icon/Action/stop.gif" /></span><span>发布</span>
                    </asp:LinkButton>
                </div>
            </td>
            <td class="ToolMenu" width="60" id="td3" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                    <asp:LinkButton runat="server" ID="cancalShutDown" OnClick="cancalShutDown_Click"
                        OnClientClick="return window.confirm('确认取消发布当前值班安排?');">
                        <span><img src="../Images/Icon/Action/delete.gif" /></span><span>取消发布</span>
                    </asp:LinkButton>
                </div>
            </td>--%>
            <td class="Fg" id="td2" runat="server">
                <img src="../Images/FgLine.gif" alt="" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="InfoContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="TextContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="TabberContentPlaceHolder" runat="Server">
    <wsc:TabberHeader ID="thInfo" runat="server" DivID="div1" Title="值班详情" Selected="true" />
    <wsc:TabberHeader ID="thForm" runat="server" DivID="div2" Title="内容" Visible="false" />
    <wsc:TabberHeader ID="thAttendencer" runat="server" DivID="div3" Title="值班人员" Visible="false" />
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Div1ContentPlaceHolder" runat="Server">
    <table cellspacing="0" cellpadding="0" border="0" class="" width="100%">
        <tr style="display: ">
            <td class="DetailHeader">
                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tr>
                        <td class="ArticleTitle">
                            <asp:Literal ID="ltTitle" runat="server" Visible="false"></asp:Literal>
                        </td>
                        <td class="ToolMenu">
                            <%--                            <div class="Normal" oldclass="Normal" style="float: left; width: 60px" onmouseover="OverChangeClass(this);"
                                onmouseout="ReturnClass(this)">
                                <asp:LinkButton runat="server" ID="lbtnSave" OnClick="lbtnSave_Click">
                                    <span><img src="../Images/Icon/Action/save.gif" alt="保存修改" /></span><span>保存</span></asp:LinkButton>
                            </div>--%>
                            <div class="Normal" oldclass="Normal" style="float: left; width: 40px" onmouseover="OverChangeClass(this);"
                                onmouseout="ReturnClass(this)">
                                <a href="javascript:printDetail();"><span>
                                    <img src="../Images/Icon/Action/print.gif" alt="打印" /></span><span>打印</span></a></div>
                            <div class="Normal" oldclass="Normal" style="float: left; width: 150px; display: none"
                                onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                                <asp:LinkButton runat="server" ID="lbtnExport"><span><img src="../Images/Icon/Action/import.gif" alt="导出值班人员联系方式" /></span><span>导出值班人员联系方式<span></asp:LinkButton></div>
                            </div>
                        </td>
                        <td width="14">
                            <a href="#">
                                <img src="../Images/Icon/icon-collapse.png" alt="字段" style="cursor: pointer;" onclick="ChangeDetailView1();"
                                    id="imgExpand1" /></a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr id="trInfo1">
            <td>
                <table id="tblDetail1" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="DetailTitle">
                            <div class="fixWidth2">
                                <a class="blue-01"><strong>值班名称：</strong></a>
                                <asp:Literal ID="ltName" runat="server"></asp:Literal></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="DetailTitle">
                            <div class="fixWidth2">
                                <a class="blue-01"><strong>值班地点：</strong></a>
                                <asp:Literal ID="ltPlace" runat="server"></asp:Literal></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="DetailTitle">
                            <div class="fixWidth2">
                                <a class="blue-01"><strong>创建时间：</strong></a>
                                <asp:Literal ID="ltCreateTime" runat="server"></asp:Literal></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="DetailTitle">
                            <div class="fixWidth2">
                                <a class="blue-01"><strong>值班内容：</strong></a>
                                <asp:Literal ID="ltDescription" runat="server"></asp:Literal>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <div style="overflow-y: auto; height: 335px; width: 100%">
                    <table id="Table1" width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="DetailTitle" style="width: 80px" nowrap align="center">
                                <div class="fixWidth2">
                                    <a class="blue-01"><strong>&nbsp;值班日期</strong></a>
                                </div>
                            </td>
                            <td class="DetailTitle" style="width: 120px" nowrap align="center">
                                <div class="fixWidth2">
                                    <a class="blue-01"><strong>&nbsp;值班时间</strong></a>
                                </div>
                            </td>
                            <td class="DetailTitle" nowrap>
                                <div class="fixWidth2">
                                    <a class="blue-01"><strong>&nbsp;值班人员</strong></a>
                                </div>
                            </td>
                            <td class="DetailTitle" style="width: 120px" nowrap align="center">
                                <div class="fixWidth2">
                                    <a class="blue-01"><strong>&nbsp;值班类型</strong></a>
                                </div>
                            </td>
                            <td class="DetailTitle" align="center" style="width: 60px" nowrap>
                                <div class="fixWidth2">
                                    <a class="blue-01"><strong>&nbsp;双休日</strong></a>
                                </div>
                            </td>
                            <td class="DetailTitle" align="center" style="width: 60px" nowrap>
                                <div class="fixWidth2">
                                    <a class="blue-01"><strong>&nbsp;节假日</strong></a>
                                </div>
                            </td>
                        </tr>
                        <asp:Repeater ID="rptItemList" runat="server" OnItemDataBound="rptItemList_ItemDataBound">
                            <ItemTemplate>
                                <tr id="TableRow_<%# Container.ItemIndex%>" class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);"
                                    onmouseout="ReturnClass(this)">
                                    <td class="DetailTitle" nowrap align="center">
                                        <div class="fixWidth2">
                                            &nbsp;<%# ((DateTime)DataBinder.Eval(Container.DataItem, "AttendDate")).ToString("yy-MM-dd")%>
                                        </div>
                                    </td>
                                    <td class="DetailTitle" nowrap align="center">
                                        <div class="fixWidth2">
                                            &nbsp;<%# ((DateTime)DataBinder.Eval(Container.DataItem, "AttendTimeStart")).ToString("HH:mm至") + ((DateTime)DataBinder.Eval(Container.DataItem, "AttendTimeEnd")).ToString("HH:mm")%>
                                        </div>
                                    </td>
                                    <td class="DetailTitle">
                                        <div class="fixWidth2">
                                            &nbsp;<asp:Label ID="labUser" runat="server"></asp:Label>
                                        </div>
                                    </td>
                                    <td class="DetailTitle" nowrap align="center">
                                        <div class="fixWidth2">
                                            &nbsp;<%#  DataBinder.Eval(Container.DataItem, "Remark")%>
                                        </div>
                                    </td>
                                    <td class="DetailTitle" align="center">
                                        <div class="fixWidth2">
                                            <asp:CheckBox runat="server" Enabled="false" ID="cbWeekEnd" Checked='<%#Eval("IsWeekEnd")%>' />
                                        </div>
                                    </td>
                                    <td class="DetailTitle" align="center">
                                        <div class="fixWidth2">
                                            <asp:CheckBox runat="server" Enabled="false" ID="cbHoliday" Checked='<%#Eval("IsHoliday")%>' />
                                        </div>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="Div2ContentPlaceHolder" runat="Server">
    <table cellspacing="0" cellpadding="0" border="0" class="" width="100%">
        <tr>
            <td class="DetailHeader">
                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                    <tr>
                        <td class="ArticleTitle">
                            <asp:Literal ID="ltTitle2" runat="server" Visible="false"></asp:Literal>
                        </td>
                        <td width="14">
                            <a href="#">
                                <img src="../Images/Icon/icon-collapse.png" alt="字段" style="cursor: pointer;" onclick="ChangeDetailView2();"
                                    id="imgExpand2" /></a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr id="trInfo2">
            <td>
                <table id="tblDetail2" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="DetailTitle">
                            <div class="fixWidth2">
                                <a class="blue-01"><strong>&nbsp;值班名称：</strong></a>
                                <asp:Literal ID="ltName2" runat="server"></asp:Literal></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="DetailTitle">
                            <div class="fixWidth2">
                                <a class="blue-01"><strong>&nbsp;值班地点：</strong></a>
                                <asp:Literal ID="ltPlace2" runat="server"></asp:Literal></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="DetailTitle">
                            <div class="fixWidth2">
                                <hr />
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="Div3ContentPlaceHolder" runat="Server">
    <%--    <table border="0" cellpadding="0" cellspacing="5" width="98%" style="margin-top: 10px">
        <tr>
            <td width="200">
                当前值班人员：
            </td>
            <td style="border: 1px solid #afcde2" colspan="2">
                <asp:DataList runat="server" GridLines="None" RepeatColumns="4" ID="dlAttendUsers">
                    <ItemTemplate>
                        <%#Eval("UserDisplayName") %>;&nbsp;
                    </ItemTemplate>
                    <ItemStyle />
                </asp:DataList>
            </td>
        </tr>
        <tr>
            <td>
                <input type="button" onclick="SelectUser();" value="选择需添加的值班人员" class="btn" />
            </td>
            <td>
                <asp:TextBox runat="server" ID="txtNewUserNames"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtNewUsers" Style="display: none"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtNewUserIDs" Style="display: none"></asp:TextBox>
            </td>
            <td width="200">
                <asp:Button runat="server" ID="btnAddUser" Text="添加" CssClass="btn" />
            </td>
        </tr>
    </table>--%>
</asp:Content>
<asp:Content ID="Content10" ContentPlaceHolderID="Div4ContentPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content11" ContentPlaceHolderID="Div5ContentPlaceHolder" runat="Server">
</asp:Content>
